package com.inns.position.hbase.config.properties;

import com.inns.position.utils.SpringContextHolder;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * 项目配置
 */
@Component
@ConfigurationProperties(prefix = InnsProperties.PREFIX)
public class InnsProperties {

    public static final String PREFIX = "inns";

    public static InnsProperties instance() {
        return SpringContextHolder.getBean(InnsProperties.class);
    }

    private String appId;
    private int offlineTime;// 单位（秒），多长时间收不到数据就认为离线
    private int maxTimes = 4;// 按照访问次数分区统计时 最大统计次数
    private int minTime;// 单位（秒），连续驻留时长最小值
    private int realTimeOnlineTime;// 单位（秒），实时在线（统计时间区间，如30秒在线人数）

    public String getAppId() {
        return appId;
    }

    public void setAppId(String appId) {
        this.appId = appId;
    }

    public int getOfflineTime() {
        return offlineTime;
    }

    public void setOfflineTime(int offlineTime) {
        this.offlineTime = offlineTime;
    }

    public int getMaxTimes() {
        return maxTimes;
    }

    public void setMaxTimes(int maxTimes) {
        this.maxTimes = maxTimes;
    }

    public int getMinTime() {
        return minTime;
    }

    public void setMinTime(int minTime) {
        this.minTime = minTime;
    }

    public int getRealTimeOnlineTime() {
        return realTimeOnlineTime;
    }

    public void setRealTimeOnlineTime(int realTimeOnlineTime) {
        this.realTimeOnlineTime = realTimeOnlineTime;
    }
}
